#ifndef TABLEWIDGET_H
#define TABLEWIDGET_H

#include <QWidget>
#include<QMouseEvent>
#include<QResizeEvent>
#include<QListWidget>
#include<QtDebug>
#include<QGraphicsSceneHoverEvent>
class tablewidget : public QListWidget
{
    Q_OBJECT
public:
    explicit tablewidget(QWidget *parent = nullptr);

    void mousePressEvent(QMouseEvent *event) override;
    void mouseMoveEvent(QMouseEvent *event) override;
    void mouseReleaseEvent(QMouseEvent *event) override;
    void resizeEvent(QResizeEvent *event) override;
    int sizeHintForRow(int row) const override
    {
        if (row == 0) return 20;
        else return 10;
    }


private:
    bool pressed;        // 鼠标是否按下
    QPoint startPos;     // 拖拽开始的位置
    QSize  startSize;    // 拖拽开始的大小
    int selectedge;
    const int redge=1;
    const int bedge=2;
    const int rbedge=3;
    const int body=4;
signals:
    void widgetResized(QSize newSize, QSize oldSize);
public slots:

};

#endif // TABLEWIDGET_H
